﻿/// WWrite a program that reads two arrays from the console and compares them element by element.

using System;
using System.Collections;

class zad_2
{
    static void getInput(ArrayList arr) 
    {
        string input = "null";
        int inNum;

        Console.WriteLine("Enter integer for arrey. Press ENTER to stop!");

        while (true)
        {
            input = Console.ReadLine();
            if (input != "")
            {
                int.TryParse(input, out inNum);
                arr.Add(input);
            }
            else
            {
                break;
            }  
        }
    }
    
    static void Main(string[] args)
    {
        ArrayList arrList1 = new ArrayList();
        ArrayList arrList2 = new ArrayList();

        Console.WriteLine("Enter arrey 1");
        getInput(arrList1);
        Console.WriteLine("Enter arrey 2");
        getInput(arrList2);

        int lenghtArr1 = arrList1.Count;
        int lenghtArr2 = arrList2.Count;

        int minLenght = Math.Min(lenghtArr1, lenghtArr2);

        for (int i = 0; i < minLenght; i++)
        {
            Console.WriteLine("{0} - {1}", arrList1[i], arrList2[i]);
        }

    }
}

